package com.jic.market.controller.rest;

import com.jic.common.base.vo.RestResult;
import com.jic.market.api.rest.ProductOrderRestApi;
import com.jic.market.request.ProductOrderRestRequest;
import com.jic.market.response.ProductMarketResponse;
import com.jic.market.response.rest.groupon.PostPayGroupInstDetailResponse;
import com.jic.market.service.ProductOrderMarketService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author pxg
 * @version V1.0
 * @className ProductOrderRestController
 * @description 订单确认下单数据计算 rest 接口
 * @date 2020/4/2
 */
@RestController
@RequestMapping("/order/cost")
@Api(tags = {"订单确认下单数据计算接口"})
@Slf4j
public class ProductOrderMarketRestController implements ProductOrderRestApi {

    @Autowired
    private ProductOrderMarketService productOrderService;

    @Override
    @PostMapping("/preOrder")
    @ApiOperation(value = "订单价格计算")
    public RestResult<ProductMarketResponse> preOrder(@RequestBody ProductOrderRestRequest request) {
        return RestResult.success(productOrderService.preOrder(request));
    }
}
